<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>卡厂付款登记</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src="${pageContext.request.contextPath }/scripts/boot.js" type="text/javascript"></script>
<style type="text/css">
<!--
#Layer1 {
	position:absolute;
	left:20%;
	top:94px;
	width:628px;
	height:325px;
	z-index:1;
}
-->
</style>
</head>

<body>

<div id="Layer1">
<form id="form">
<div style="width:100%;" align="center">
  <div class="mini-toolbar" style="border-bottom:0;padding:0px;">
    <table style="width:100%;">
      <tr>
        <td style="width:100%;text-align:center;"><font face="宋体"><strong>卡厂付款登记</strong></font></td>
      </tr>
    </table>
  </div>
</div>
<div >
<table  style="width:100%;border:solid 1px #aaa;width:100%;">
<tr>
<td height="49" style="white-space:nowrap;width:90px ;text-align:right">制卡批次</td>
<td><input name="aaz001" class="mini-textbox" width="80%" emptyText="请输入制卡批次"  allowInput="false" readonly="true" inputStyle="background:rgb(241,241,243)" onenter="onKeyEnter" /></td>
<td style="white-space:nowrap;width:90px ;text-align:right">银行</td>
<td><input name="aae008" class="mini-combobox" width="80%" textField="aaa103" valueField="aaa102" inputStyle="background:rgb(241,241,243)" allowInput="false" readonly="true" emptyText="请选择..." 
 url="${pageContext.request.contextPath }/kid.do?method=getyinhang&sj=bank"
/></td>
</tr>
<tr>
<td height="40" style="white-space:nowrap;width:90px ;text-align:right">付款时间</td>
<td><input name="aaz714" class="mini-datepicker" width="80%" required="true" emptyText="请输入付款时间" /></td>
<td style="white-space:nowrap;width:90px ;text-align:right">付款金额</td>
<td><input name="aaz713" class="mini-textbox" width="80%" required="true" emptyText="请输入付款金额" /></td>
</tr>
<tr>
<td height="45" style="white-space:nowrap;width:90px ;text-align:right">到卡数量</td>
<td><input name="aaz709" class="mini-textbox" width="80%"  inputStyle="background:rgb(241,241,243)" allowInput="false" readonly="true" /></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="40" colspan="4" style="width:100%;text-align:center;">
          <a class="mini-button" iconCls="icon-ok" onclick="onOk" >确认</a>
          <a class="mini-button" iconCls="icon-close"  onclick="onCancel">取消</a>
</td>
</tr>
</table>
</div>
</form>
</div>
<script type="text/javascript">
mini.parse();  
var form = new mini.Form("form");
  function onOk(e) {
        
           SaveData();                                      	
        }
        
    /* function  SaveData()
    {
            var o = form.getData();				
			form.validate();
			if (form.isValid() == false)
			return;
			var json = mini.encode([o]);		
			$.ajax({
				url : "/sbk/kid.do?method=saveunit",
				type : 'post',
				data : {
					data : json
				},
				cache : false,
				success : function(text) {
				    if("0"== text)
				    {
				     alert("登记成功");
				    }
				    else
				    {
				      alert("登记失败:"+text);
				    }					   			
					form.clear();				    	
				},
				error : function(jqXHR, textStatus, errorThrown) {
					mini.alert(jqXHR.responseText);					
				}
			});             
    }   */
    
     function SetData(data) {
            if (data.action == "edit") {
                //跨页面传递的数据对象，克隆后才可以安全使用              
                data = mini.clone(data);                        
                $.ajax({               
                    url: "/sbk/kid.do?method=getnumber",
                    cache: false,
                    data:{id:data.id,bank:data.bank},
                    success: function (text) {                 
                        var o = mini.decode(text);                      
                        form.setData(o);
                        form.setChanged(false);
                      
                    }
                });
            }
        } 
        
         function SaveData() {
            var o = form.getData();            
            form.validate();
            var json = mini.encode([o]);  
            if (form.isValid() == false){
            return;   
            } else {
            $.ajax({
                url: "/sbk/kid.do?method=kcfkdj",
				type: 'post',
                data: { data: json},
                cache: false,
                success: function (text) {
                    CloseWindow("save");
                },
                error: function (jqXHR, textStatus, errorThrown) {
                    mini.alert(jqXHR.responseText);
                    CloseWindow();
                }
            });
            }   
        }
    
  function GetData() {
            var o = form.getData();
            return o;
        }
  function onCancel(e) {
          
            CloseWindow("cancel");
        }
        
         function CloseWindow(action) {            
            if (action == "close" && form.isChanged()) {
                if (confirm("数据被修改了，是否先保存？")) {
                    return false;
                }
            }
            if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
            else window.close();            
        }
</script>
</body>
</html>
